#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	return 0;
}

List Merge(List L1, List L2)
{
	List tmp1, tmp2, p, tmp;
	tmp1 = L1->Next;
	tmp2 = L2->Next;
	p = (List)malloc( sizeof(struct Node) );
	p->Next = null;
	
	tmp = p;
	
	while(tmp1&&tmp2){
		if(tmp1->Data < tmp2->Data){
			tmp->Next = tmp1;
			tmp = tmp->Next;
			tmp1 = tmp1->next;
		}else{
			tmp->Next = tmp2;
			tmp = tmp->Next;
			tmp2 = tmp2->Next; 
		}
		
	}
	
	while(tmp1!=null){
		tmp->Next = tmp1;
		tmp= tmp-Next;
		tmp1 = tmp1->Next;
	}
	while(tmp2!=null){
		tmp->Next = tmp2;
		tmp= tmp-Next;
		tmp2 = tmp2->Next;
	}
	
	L1->Next = null;
	L2->Next = null;
	tmp->Next =null;
	
	return p;
	
}
